import { RouteRecordRaw } from "vue-router"

const Layout = () => import("@/layouts/index.vue")

export const useRoutes = [
  {
    // 个人信息页，包含个人信息，可修改密码
    path: "/user-info",
    component: Layout,
    redirect: "/user-info",
    meta: {
      hidden: true,
      roles: ["user"]
    },
    children: [
      {
        path: "",
        component: () => import("@/views/user-info/index.vue"),
        name: "userInfo",
        meta: {
          title: "个人信息",
          roles: ["user"]
        }
      }
    ]
  },
  {
    // 工作详情
    path: "/job-details/:id",
    component: Layout,
    meta: {
      roles: ["user"],
      hidden: true
    },
    children: [
      {
        path: "",
        component: () => import("@/views/job-details/id.vue"),
        name: "jobDetails",
        meta: {
          title: "职位描述",
          roles: ["user"],
          hidden: true
        },
        props: true
      }
    ]
  },
  {
    // 简历
    path: "/resume",
    component: Layout,
    redirect: "/resume",
    meta: {
      roles: ["user"]
    },
    children: [
      {
        path: "",
        component: () => import("@/views/resume/index.vue"),
        name: "resume",
        meta: {
          title: "简历",
          roles: ["user"],
          svgIcon: "resume"
        }
      }
    ]
  },
  {
    // 投递进度
    path: "/post-schedule",
    component: Layout,
    redirect: "/post-schedule",
    meta: {
      roles: ["user"]
    },
    children: [
      {
        path: "",
        component: () => import("@/views/post-schedule/index.vue"),
        name: "resumeDynamics",
        meta: {
          title: "投递进度",
          roles: ["user"],
          svgIcon: "schedule"
        }
      }
    ]
  }
] as RouteRecordRaw[]
